/*
 * Copyright (c) 2011 Todd Brady
 *
 * PS3Theatre is freely distributable under the terms of the MIT license.
 * For details, see the MIT-Liscence web site: http://www.opensource.org/licenses/mit-license.php 
 */
function clock() {
	var digital = new Date();
	var hours = digital.getHours();
	var minutes = digital.getMinutes();
	var amOrPm = "AM";
	if (hours > 11) amOrPm = "PM";
	if (hours > 12) hours = hours - 12;
	if (hours == 0) hours = 12;
	if (hours <= 9) hours = "0" + hours;
	if (minutes <= 9) minutes = "0" + minutes;
	dispTime = hours + ":" + minutes + " " + amOrPm;
	$('time').innerHTML = dispTime;
	setTimeout("clock()", 60000);
}